<extend name="Base/common"/>
<block name="style">
    <link  rel="stylesheet"  href="__PUBLIC__/Wap/css/member.css">
</block>

<block name="content">
    <div  id="loadingPicBlock">
        <input  name="hidTotalCount"  type="hidden"  id="hidTotalCount">
        <input  name="hidPageMax"  type="hidden"  id="hidPageMax">
        <div  class="wrapper">
            <div  class="m_buylist_nav"><span>您成功竞得了<em  class="orange">{:count($order_list)}</em>个商品</span></div><div  class="m_buylist m_get marginB">
            <ul  id="divOrderList">
               <notempty name="order_list">
                <volist name="order_list" id="order">
                    <?php
                         $bid_good=M('bid_good')->where(array('bid_id'=>$order['bid_id'],'id'=>$order['good_id']))->find();
                         $good_info=M('goods')->where(array('id'=>$bid_good['good_id']))->find();
                         $good_info['good_img_arr']=explode(',',$good_info['good_img']);
                    ?>
                    <li>
                     <cite>
                         <a  href="{:U('Index/details', array('id' => $order['good_id']))}">
                             <img  src="__ROOT__{$good_info['good_img_arr'][0]}"></a>
                         <i>
                             <switch name="order.status">
                                 <case value="1">待付款</case>
                                 <case value="2">待收货</case>
                                 <case value="3">
                                     <?php
                                         $return=M('return_list')->where(array('order_id'=>$order['id']))->find();
                                     ?>
                                     <empty name="return">
                                         已收货
                                      <else/>
                                         已退货
                                     </empty>
                                 </case>
                             </switch>
                         </i>
                     </cite>
                     <dl>
                         <dt>
                             结算单号: {$order.order_sn}
                         </dt>
                         <dt>
                             <a  href="{:U('Index/details', array('id' => $order['good_id']))}" class="gray6">{$good_info['goods_name']}</a>
                         </dt>
                         <dt>结算金额：{$order['total_price']}元</dt>

                         <dd>
                            <switch name="order.status">
                                 <case value="1">
                                     <span class="status">待付款</span>
                                 </case>
                                 <case value="2">
                                     <a  href="javascript:" onclick="setOrderStatus($(this))" data-url="{:U('setOrderStatus',array('id'=>$order['id'],'status'=>3))}"  class="orangeBtn">确认收货</a>
                                 </case>
                                 <case value="3">
                                     <empty name="return">
                                         <a href="{:U('submitReturnOrder',array('order_id'=>$order['id']))}" class="orangeBtn">退货</a>
                                     <else/>
                                         <span class="status">
                                          <if condition="$return['status'] eq 1">
                                             退货正在处理
                                         <else/>
                                             已退货
                                         </if>
                                        </span>
                                     </empty>
                                 </case>
                           </switch>

                         </dd>
                     </dl>
                 </li>
                </volist>
              <else/>
                  <div class="noRecords gray9"><s></s>暂无记录</div>
               </notempty>
                <div  id="divOrderLoading"  class="loading"  style="display: none;"><b></b>正在加载</div>
            </ul>
        </div>
            <div  class="load_more"  id="btnLoadMore"  style="display: none;"><a  href="javascript:;"  title="加载更多">加载更多</a></div>

        </div>
    </div>
</block>

<block name="footer">
    <div class="footer" style="bottom: 0px;">
        <ul>
            <li class="f_home"><a href="{:U('Index/index')}" title="首页"><i class="icon iconfont">&#xe61c;</i>首页</a></li>
            <li class="f_whole"><a href="{:U('Public/introduction')}" title="竞价介绍"><i class="icon iconfont">&#xe627;</i>竞价介绍</a></li>
            <li class="f_personal"><a href="{:U('Agent/profile')}" class="hover" title="个人中心"><i class="icon iconfont">&#xe61e;</i>个人中心</a></li>
        </ul>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        function setOrderStatus(self){
            var url=self.attr('data-url')
            $.get(url, function(data){
                if(data.status==1){
                    alert(data.info);
                    window.location.reload();
                }else{
                    alert(data.info);
                }
            });
        }
    </script>
</block>
